export default [
  {
    url: "/tick-basic/sys/permission",
    method: "GET",
    timeout: 3000, // 超时事件
    statusCode: 200, // 返回的http状态码
    response: (option: any) => {
      let permissions: any = [];
      if (option.query.userName === "admin") {
        permissions = [
          {
            path: "/dashboard",
            name: "dashboard",
            component: "analysis/index",
            meta: {
              title: "Dashboard",
              breadcrumb: ["分析页面"],
              keep: false,
              icon: "LineChartOutlined",
              role: ["admin"],
              hidden: false,
            },
          },
          {
            path: "/charts",
            name: "charts",
            meta: {
              title: "图表",
              icon: "BarChartOutlined",
              role: ["admin", "root"],
            },
            children: [
              {
                path: "/charts/map",
                component: "charts/map",
                name: "echartsMap",
                meta: { title: "地图", role: ["admin", "root"] },
              },

              {
                path: "/charts/pie",
                component: "charts/pie",
                name: "echartsPie",
                meta: { title: "饼图", role: ["admin", "root"] },
              },
              {
                path: "/charts/smartCity",
                component: "charts/smartCity",
                name: "smartCity",
                meta: { title: "three+maptalks", role: ["admin", "root"] },
              },
            ],
          },
          {
            path: "/ability",
            name: "ability",
            meta: {
              title: "功能",
              keepalive: false,
              icon: "InfoCircleOutlined",
              role: ["admin"],
              hidden: false,
            },
            children: [
              {
                path: "/ability/language",
                name: "language",
                component: "ability/language/index",
                meta: {
                  title: "国际化",
                  breadcrumb: ["功能", "国际化"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/ability/waterMark",
                name: "waterMark",
                component: "ability/waterMark/index",
                meta: {
                  title: "页面水印",
                  breadcrumb: ["功能", "页面水印"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/ability/fileDownload",
                name: "fileDownload",
                component: "ability/fileDownload/index",
                meta: {
                  title: "文件下载",
                  breadcrumb: ["功能", "文件下载"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/ability/print",
                name: "print",
                component: "ability/print/index",
                meta: {
                  title: "打印",
                  breadcrumb: ["功能", "打印"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/ability/autograph",
                name: "autograph",
                component: "ability/autograph/index",
                meta: {
                  title: "电子签名",
                  breadcrumb: ["功能", "电子签名"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/ability/excel",
                name: "ability/excel",
                meta: {
                  title: "Excel",
                  keepalive: false,
                  icon: "",
                  role: ["admin"],
                  hidden: false,
                },
                children: [
                  {
                    path: "/ability/excel/ImportExcel",
                    name: "ImportExcel",
                    component: "ability/excel/ImportExcel",
                    meta: {
                      title: "标准表格导入",
                      breadcrumb: ["功能", "标准表格导入"],
                      keepalive: true,
                      role: ["admin"],
                      hidden: false,
                    },
                  },
                  {
                    path: "/ability/excel/exportExcel",
                    name: "exportExcel",
                    component: "ability/excel/exportExcel",
                    meta: {
                      title: "JSON数据导出",
                      breadcrumb: ["功能", "JSON数据导出"],
                      keepalive: true,
                      role: ["admin"],
                      hidden: false,
                    },
                  },
                ],
              },
              {
                path: "/ability/utilsDemo",
                name: "utilsDemo",
                component: "ability/utilsDemo/index",
                meta: {
                  title: "utils 工具函数",
                  breadcrumb: ["功能", "utils 工具函数"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
            ],
          },
          {
            path: "/components",
            name: "components",
            meta: {
              title: "组件库",
              icon: "AppstoreOutlined",
              role: ["admin", "root"],
            },
            children: [
              {
                path: "/components/table",
                component: "components/table/index",
                name: "table",
                meta: { title: "表格", role: ["admin", "root"] },
              },
              {
                path: "/components/ui",
                component: "components/ui/index",
                name: "ui",
                meta: { title: "UI库", role: ["admin", "root"] },
              },
            ],
          },

          {
            path: "/graphicEditor",
            name: "graphicEditor",
            alwaysShow: true,
            meta: {
              title: "图形编辑器",
              keepalive: false,
              icon: "FundViewOutlined",
              role: ["admin", "root"],
              hidden: false,
            },
            children: [
              {
                path: "/graphicEditor/logicflow",
                component: "graphicEditor/logicflow/index",
                name: "logicflow",
                meta: {
                  title: "流程图",
                  breadcrumb: ["图形编辑器", "流程图"],
                  keepalive: true,
                  role: ["admin", "root"],
                  hidden: false,
                },
              },
              {
                path: "/graphicEditor/svgEdit",
                component: "graphicEditor/svgEdit/index",
                name: "svgEdit",
                meta: {
                  title: "svgEdit",
                  breadcrumb: ["图形编辑器", "svgEdit"],
                  keepalive: true,
                  role: ["admin", "root"],
                  hidden: false,
                },
              },
              {
                path: "/graphicEditor/canvas",
                component: "graphicEditor/canvas/index",
                name: "canvas",
                meta: {
                  title: "canvas",
                  breadcrumb: ["图形编辑器", "canvas"],
                  keepalive: true,
                  role: ["admin", "root"],
                  hidden: false,
                },
              },
            ],
          },
          {
            path: "/system",
            name: "system",
            meta: {
              title: "系统管理",
              keepalive: false,
              icon: "SettingOutlined",
              role: ["admin"],
              breadcrumb: ["系统管理"],
              hidden: false,
            },
            children: [
              {
                path: "/system/role",
                name: "role",
                component: "system/role/index",
                meta: {
                  title: "角色管理",
                  breadcrumb: ["系统管理", "角色管理"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/system/menu",
                name: "menu",
                component: "system/menu/index",
                meta: {
                  title: "菜单管理",
                  breadcrumb: ["系统管理", "菜单管理"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/system/dept",
                name: "dept",
                component: "system/dept/index",
                meta: {
                  title: "部门管理",
                  breadcrumb: ["系统管理", "部门管理"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/system/account",
                name: "account",
                component: "system/dept/index",
                meta: {
                  title: "账号管理",
                  breadcrumb: ["系统管理", "账号管理"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
              {
                path: "/system/changePassword",
                name: "changePassword",
                component: "system/changePassword/index",
                meta: {
                  title: "修改密码",
                  breadcrumb: ["系统管理", "修改密码"],
                  keepalive: true,
                  role: ["admin"],
                  hidden: false,
                },
              },
            ],
          },
          {
            path: "/about",
            name: "about",
            component: "AboutView",
            meta: {
              title: "关于",
              breadcrumb: ["关于"],
              keepalive: true,
              icon: "QuestionCircleOutlined",
              role: ["admin"],
              hidden: false,
            },
          },
        ];
      } else if (option.query.userName === "test") {
        permissions = [
          {
            path: "/dashboard",
            name: "dashboard",
            component: "analysis/index",
            meta: {
              title: "Dashboard",
              breadcrumb: ["分析页面"],
              keep: false,
              icon: "LineChartOutlined",
              role: ["admin"],
              hidden: false,
            },
          },
          {
            path: "/about",
            name: "about",
            component: "AboutView",
            meta: {
              title: "关于",
              breadcrumb: ["关于"],
              keepalive: true,
              icon: "QuestionCircleOutlined",
              role: ["admin"],
              hidden: false,
            },
          },
        ];
      }
      return {
        code: 200,
        message: "获取列表成功",
        success: true,
        data: {
          permissions,
        },
      };
    },
  },
];
